#include<iostream>
using namespace std;
enum game{s,b,j};
int main(){
	int x,y;
	game g1,g2;
	scanf("%d%d",&x,&y);
	g1=game(x);
	g2=game(y);
	if(g1==g2){
		printf("0\n");
	}else if(g1==s&&g2==j||g1==j&&g2==b||g1==b&&g2==s){
		printf("1\n");
	}else if(g2==s&&g1==j||g2==j&&g1==b||g2==b&&g1==s){
		printf("-1\n");
	}
	return 0;
}
